#ifndef __CUHB_RGN_H__
#define __CUHB_RGN_H__

/*
  Copyright (c) 2010 Davide Rossetti (davide.rossetti@roma1.infn.it)

  This file is part of CuHB (CUDA Heisenberg) package.
  
  CuHB is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  CuHB is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with CuHB.  If not, see <http://www.gnu.org/licenses/>.

*/

typedef uint  rng_int_t;
typedef uint2 rng_int2_t;
typedef uint4 rng_int4_t;

struct rng_state;

struct rng_uniform {
    rng_state *m_gpu_states;
    rng_state *m_cpu_states;
    size_t m_n_blocks;
    size_t m_block_size;

    rng_uniform(size_t block_size, size_t n_blocks);
    ~rng_uniform();
    void init(uint seed, bool equal_blocks);
    rng_state *gpu_states();
    size_t block_size() { return m_block_size; }
    size_t n_blocks() { return m_n_blocks; }

    rng_int_t gen_uniform_int(size_t using_block = 0);

    float gen_uniform_float(size_t using_block = 0);
    float2 gen_uniform_float2(size_t using_block = 0);

    float gen_gaussian_float(size_t using_block = 0);
    float2 gen_gaussian_float2(size_t using_block = 0);
};

/*
 * Local variables:
 *  mode: c++
 *  c-indent-level: 4
 *  c-basic-offset: 4
 *  tab-width: 4
 *  indent-tabs-mode: nil
 * End:
 */

#endif // __CUHB_RGN_H__
